package com.yazi.mxz.behavior.dao.impl;

import org.hibernate.Criteria;
import org.hibernate.criterion.Example;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;



import com.myframework.smhj.hibernate.Searching;
import com.myframework.smhj.hibernate.Page;
import com.myframework.smhj.hibernate.dao.BasicDao;
import com.yazi.mxz.behavior.dao.StoreGoodsDao;
import com.yazi.mxz.behavior.entity.beans.StoreGoods;

/**
 * 
 * @author mo_yq5
 * @date 2014-2-1
 */
@Repository("storeGoodsDao")
public class StoreGoodsDaoImpl extends BasicDao<StoreGoods> implements StoreGoodsDao {


	public StoreGoodsDaoImpl() {
		super(StoreGoods.class);
	}

	@Override
	public Criteria getExample(StoreGoods storeGoods, String searchWord) {
		Criteria c = createCriteria(StoreGoods.class);
		
		Example example = Example.create(storeGoods);
		c.add(example);
		
		
		return c;
	}
	
	@Override
	public Page<StoreGoods> listByGtUpdateTime(long updateTime, Searching si) {
		Criteria c = createCriteria(StoreGoods.class);
		c.add(Restrictions.gt("updateTime", updateTime));
		return list(c, si);
	}

}
